<template>
    <div>
        Child-{{ title }}
        <button @click="handleHome">Home</button>
    </div>
</template>

<script setup>
// 父传子通信 defineProps属性验证
const props = defineProps({
    title: {
        type: String,
        // required: String,//是否必须
        default: '0000'//默认值
    }
})
console.log(props.title);

// 子传父通信
const sex = '男'
const emit = defineEmits(["right"])
const handleHome = () => {
    emit("right",'来自子组件的问候', sex)
}

</script>